\(\int \sqrt {1+\tan ^2(x)} \, dx\) [288]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 10, antiderivative size = 3 \[ \int \sqrt {1+\tan ^2(x)} \, dx=\text {arcsinh}(\tan (x)) \]

[Out]

arcsinh(tan(x))

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 3, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.300, Rules used = {3738, 4207, 221} \[ \int \sqrt {1+\tan ^2(x)} \, dx=\text {arcsinh}(\tan (x)) \]

[In]

Int[Sqrt[1 + Tan[x]^2],x]

[Out]

ArcSinh[Tan[x]]

Rule 221

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Simp[ArcSinh[Rt[b, 2]*(x/Sqrt[a])]/Rt[b, 2], x] /; FreeQ[{a, b},
 x] && GtQ[a, 0] && PosQ[b]

Rule 3738

Int[(u_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Int[ActivateTrig[u*(a*sec[e + f*x]^2)^p]
, x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a, b]

Rule 4207

Int[((b_.)*sec[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[b*(ff/
f), Subst[Int[(b + b*ff^2*x^2)^(p - 1), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{b, e, f, p}, x] &&  !IntegerQ[p
]

Rubi steps \begin{align*} \text {integral}& = \int \sqrt {\sec ^2(x)} \, dx \\ & = \text {Subst}\left (\int \frac {1}{\sqrt {1+x^2}} \, dx,x,\tan (x)\right ) \\ & = \text {arcsinh}(\tan (x)) \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(14\) vs. \(2(3)=6\).

Time = 0.01 (sec) , antiderivative size = 14, normalized size of antiderivative = 4.67 \[ \int \sqrt {1+\tan ^2(x)} \, dx=\text {arctanh}(\sin (x)) \cos (x) \sqrt {\sec ^2(x)} \]

[In]

Integrate[Sqrt[1 + Tan[x]^2],x]

[Out]

ArcTanh[Sin[x]]*Cos[x]*Sqrt[Sec[x]^2]

Maple [A] (verified)

Time = 0.06 (sec) , antiderivative size = 4, normalized size of antiderivative = 1.33

method result size
derivativedivides \(\operatorname {arcsinh}\left (\tan \left (x \right )\right )\) \(4\)
default \(\operatorname {arcsinh}\left (\tan \left (x \right )\right )\) \(4\)
risch \(2 \sqrt {\frac {{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}+1\right )^{2}}}\, \ln \left ({\mathrm e}^{i x}+i\right ) \cos \left (x \right )-2 \sqrt {\frac {{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}+1\right )^{2}}}\, \ln \left ({\mathrm e}^{i x}-i\right ) \cos \left (x \right )\) \(62\)

[In]

int((1+tan(x)^2)^(1/2),x,method=_RETURNVERBOSE)

[Out]

arcsinh(tan(x))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 60 vs. \(2 (3) = 6\).

Time = 0.27 (sec) , antiderivative size = 60, normalized size of antiderivative = 20.00 \[ \int \sqrt {1+\tan ^2(x)} \, dx=\frac {1}{2} \, \log \left (\frac {\tan \left (x\right )^{2} + \sqrt {\tan \left (x\right )^{2} + 1} \tan \left (x\right ) + 1}{\tan \left (x\right )^{2} + 1}\right ) - \frac {1}{2} \, \log \left (\frac {\tan \left (x\right )^{2} - \sqrt {\tan \left (x\right )^{2} + 1} \tan \left (x\right ) + 1}{\tan \left (x\right )^{2} + 1}\right ) \]

[In]

integrate((1+tan(x)^2)^(1/2),x, algorithm="fricas")

[Out]

1/2*log((tan(x)^2 + sqrt(tan(x)^2 + 1)*tan(x) + 1)/(tan(x)^2 + 1)) - 1/2*log((tan(x)^2 - sqrt(tan(x)^2 + 1)*ta
n(x) + 1)/(tan(x)^2 + 1))

Sympy [F]

\[ \int \sqrt {1+\tan ^2(x)} \, dx=\int \sqrt {\tan ^{2}{\left (x \right )} + 1}\, dx \]

[In]

integrate((1+tan(x)**2)**(1/2),x)

[Out]

Integral(sqrt(tan(x)**2 + 1), x)

Maxima [A] (verification not implemented)

none

Time = 0.34 (sec) , antiderivative size = 3, normalized size of antiderivative = 1.00 \[ \int \sqrt {1+\tan ^2(x)} \, dx=\operatorname {arsinh}\left (\tan \left (x\right )\right ) \]

[In]

integrate((1+tan(x)^2)^(1/2),x, algorithm="maxima")

[Out]

arcsinh(tan(x))

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 16 vs. \(2 (3) = 6\).

Time = 0.25 (sec) , antiderivative size = 16, normalized size of antiderivative = 5.33 \[ \int \sqrt {1+\tan ^2(x)} \, dx=-\log \left (\sqrt {\tan \left (x\right )^{2} + 1} - \tan \left (x\right )\right ) \]

[In]

integrate((1+tan(x)^2)^(1/2),x, algorithm="giac")

[Out]

-log(sqrt(tan(x)^2 + 1) - tan(x))

Mupad [B] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 3, normalized size of antiderivative = 1.00 \[ \int \sqrt {1+\tan ^2(x)} \, dx=\mathrm {asinh}\left (\mathrm {tan}\left (x\right )\right ) \]

[In]

int((tan(x)^2 + 1)^(1/2),x)

[Out]

asinh(tan(x))